import request from "./request";

export const login = (login_form: any)=>{
    return request({
        url: '/login',
        method: 'post',
        data: login_form
    })
}

export const getTeacherList = ()=>{
    return request({
        url: '/getTeacherList',
        method: 'get'
    })
}

export const selectTeacher = (id: String, teacherId: string) => {
    return request({
        url: "/selectTeacher",
        method: "post",
        data: {
            _id: id,
            teacherId: teacherId
        }
    })
}

export const getStudentList = (studentList: any) => {
    return request({
        url: "/getStudentList",
        method: "get",
        params: {
            studentList: studentList
        }
    })
}

export const deleteStudent = (_id: string, studentId: string)=>{
    return request({
        url: "/deleteStudent",
        method: "post",
        data:{
            _id: _id,
            studentId: studentId
        }
    })
}

/**
 * 修改密码
 * @param id
 * @param pwd
 */
export const changePassword = (id: string, pwd: string) => {
    return request({
        url: "/changePassword",
        method: "post",
        data:{
            _id: id,
            password2: pwd
        }
    })
}


export const getSingleTeacherInfo = (id: string) => {
    return request({
        url: "/getSingleTeacherInfo",
        method: "get",
        params:{
            id: id
        }
    })
}
